package home_work7;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class test2 {

	public static void main(String[] args) throws IOException {
		FileInputStream fis = new FileInputStream("myfile.txt");
		BufferedInputStream src = new BufferedInputStream(fis);
		FileOutputStream fos = new FileOutputStream("myfile_cp2.txt");
		BufferedOutputStream desc = new BufferedOutputStream(fos);
		byte[] buffer = new byte[20 * 1024];
		while ((src.read(buffer,0,buffer.length))!=-1){
			desc.write(buffer);
		}
		src.close();
		desc.close();

	}

}
